package byteutil

import (
	"encoding/binary"
)

/**
 * Big Endian
 * @since 0.9
 */
const BIG_ENDIAN = 0
/**
 * Little Endian
 * @since 0.9
 */
const LITTLE_ENDIAN = 1
	
/**
 */
func readString(b []byte) (string, int32, error) {
	lens := int32(binary.LittleEndian.Uint32(b))
//	fmt.Println("lens :",lens)
	if lens > 0 {
		tlens := 4+lens
		return string(b[4:tlens]), tlens, nil
	}
	return "", 4, nil
}

func readBoolean(b []byte, offset, endian int) bool {
	re := false
	if(b[offset] == 1) {
		re = true
	}
	return re
}